package com.grm.sys.service.impl;

import com.grm.common.utils.JwtUtil;
import com.grm.common.utils.RedisUtil;
import com.grm.sys.constant.SysUserConstant;
import com.grm.sys.service.LogoutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LogoutServiceImpl implements LogoutService {
    @Autowired
    private JwtUtil jwtUtil;
    @Autowired
    private RedisUtil redisUtil;

    @Override
    public void logout() {
        // 退出登录
        // 删除token
        redisUtil.delete(String.format("token_%s", jwtUtil.getUsername()));
    }
}
